container_class->remove = gtk_button_box_remove;
container_class->set_child_property = gtk_button_box_set_child_property;
container_class->get_child_property = gtk_button_box_get_child_property;
+ gtk_container_class_handle_border_width (container_class);
/* FIXME we need to override the "spacing" property on GtkBox once
* libgobject allows that.
gint max_size;
gint total_size;
gint spacing;
- guint border_width;
GtkOrientation orientation;
gint *widths;
gint *heights;
else
requisition->width = max_size;
}
-
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- requisition->width += border_width * 2;
- requisition->height += border_width * 2;
}
static void
gint height = 0;
gint childspacing = 0;
gint spacing;
- guint border_width;
GtkOrientation orientation;
gint ipad_x, ipad_y;
gint *widths;
bbox = GTK_BUTTON_BOX (widget);
priv = bbox->priv;
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
spacing = gtk_box_get_spacing (GTK_BOX (widget));
gtk_widget_set_allocation (widget, allocation);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- width = allocation->width - border_width*2;
+ width = allocation->width;
else
- height = allocation->height - border_width*2;
+ height = allocation->height;
switch (priv->layout_style)
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
childspacing = (width - total_size) / (nvis_children + 1);
- x = allocation->x + border_width + childspacing;
+ x = allocation->x + childspacing;
secondary_x = x + primary_size + n_primaries * childspacing;
}
else
{
childspacing = (height - total_size) / (nvis_children + 1);
- y = allocation->y + border_width + childspacing;
+ y = allocation->y + childspacing;
secondary_y = y + primary_size + n_primaries * childspacing;
}
if (nvis_children >= 2)
{
childspacing = (width - total_size) / (nvis_children - 1);
- x = allocation->x + border_width;
+ x = allocation->x;
secondary_x = x + primary_size + n_primaries * childspacing;
}
else
if (nvis_children >= 2)
{
childspacing = (height - total_size) / (nvis_children - 1);
- y = allocation->y + border_width;
+ y = allocation->y;
secondary_y = y + primary_size + n_primaries * childspacing;
}
else
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
childspacing = spacing;
- x = allocation->x + border_width;
+ x = allocation->x;
secondary_x = allocation->x + allocation->width
- - secondary_size - spacing * (n_secondaries - 1) - border_width;
+ - secondary_size - spacing * (n_secondaries - 1);
}
else
{
childspacing = spacing;
- y = allocation->y + border_width;
+ y = allocation->y;
secondary_y = allocation->y + allocation->height
- - secondary_size - spacing * (n_secondaries - 1) - border_width;
+ - secondary_size - spacing * (n_secondaries - 1);
}
break;
{
childspacing = spacing;
x = allocation->x + allocation->width
- - primary_size - spacing * (n_primaries - 1) - border_width;
- secondary_x = allocation->x + border_width;
+ - primary_size - spacing * (n_primaries - 1);
+ secondary_x = allocation->x;
}
else
{
childspacing = spacing;
y = allocation->y + allocation->height
- - primary_size - spacing * (n_primaries - 1) - border_width;
- secondary_y = allocation->y + border_width;
+ - primary_size - spacing * (n_primaries - 1);
+ secondary_y = allocation->y;
}
break;
(allocation->width
- (primary_size + spacing * (n_primaries - 1))) / 2
+ (secondary_size + n_secondaries * spacing) / 2;
- secondary_x = allocation->x + border_width;
+ secondary_x = allocation->x;
}
else
{
(allocation->height
- (primary_size + spacing * (n_primaries - 1))) / 2
+ (secondary_size + n_secondaries * spacing) / 2;
- secondary_y = allocation->y + border_width;
+ secondary_y = allocation->y;
}
break;